<?php

namespace App\Models\User;

use App\Models\BaseModel;

/**
 * App\Models\User\Withdrawal
 *
 * @property int $id
 * @property int $user_id 用户ID
 * @property string $name 真实姓名
 * @property string $access 收款账号
 * @property string $trade_no 第三方交易号
 * @property int $type 类型 银行卡:1 支付宝:2 微信:3
 * @property string $total_price 提现金额
 * @property int $status 提现状态 提现申请:0 审核通过:1 审核失败:2
 * @property \Illuminate\Support\Carbon|null $created_at
 * @property \Illuminate\Support\Carbon|null $updated_at
 * @property string|null $remarks 备注信息
 * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Member\Member[] $email
 * @property-read int|null $email_count
 * @property-read \Illuminate\Notifications\DatabaseNotificationCollection|\Illuminate\Notifications\DatabaseNotification[] $notifications
 * @property-read int|null $notifications_count
 * @method static \Illuminate\Database\Eloquent\Builder|Withdrawal newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|Withdrawal newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|Withdrawal query()
 * @method static \Illuminate\Database\Eloquent\Builder|Withdrawal whereAccess($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Withdrawal whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Withdrawal whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Withdrawal whereName($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Withdrawal whereRemarks($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Withdrawal whereStatus($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Withdrawal whereTotalPrice($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Withdrawal whereTradeNo($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Withdrawal whereType($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Withdrawal whereUpdatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Withdrawal whereUserId($value)
 * @mixin \Eloquent
 * @property string $amount 申请金额
 * @property string $arrival_amount 到账金额
 * @property string $service_charge 手续费
 * @method static \Illuminate\Database\Eloquent\Builder|Withdrawal whereAmount($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Withdrawal whereArrivalAmount($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Withdrawal whereServiceCharge($value)
 */
class Withdrawal extends BaseModel {

	protected $table = 'withdrawal';
	protected $fillable = [
		'user_id',
		'name',
		'access',
		'type',
		'trade_no',
		'service_charge',
		'amount',
		'arrival_amount',
		'status',
	];

	//关系表
	public function email ()
	{
		return $this->hasMany('App\Models\Member\Member','id','user_id');
	}
}
